package com.woniuxy.orderserver.controller;

import com.woniuxy.orderserver.pojo.FinanceOrderDetail;
import com.woniuxy.orderserver.service.FinanceOrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
public class OrderDetailController {
    @Autowired
    FinanceOrderDetailService financeOrderDetailService;

    @PostMapping("/addOrderDetail")
    public void addOrderDetail(){
        try {
            List<FinanceOrderDetail> financeOrderDetails = financeOrderDetailService.addOrderDetail();
            financeOrderDetailService.saveBatch(financeOrderDetails);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
